package com.cc.pms.controller;


import com.cc.pms.domain.vo.UserVo;
import com.cc.pms.service.IUserService;
import com.cc.common.annotation.Anonymous;
import com.cc.common.core.domain.R;
import com.cc.pms.domain.vo.*;
import com.cc.pms.service.*;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping("/user")
public class UserController {


    @Resource
    private IUserService iUserService;


    @Anonymous
    @PostMapping("/login")
    public R<Map<String , String>> login(@RequestBody UserVo userVo){
        return iUserService.loginService(userVo);
    }

    @Anonymous
    @PostMapping("/register")
    public R<Map<String , Long>> register(@RequestBody UserVo userVo){
        return iUserService.registerUser(userVo);
    }

    @Anonymous
    @PostMapping("/forget-password")
    public R<Boolean> forgetPassword(@RequestBody UserVo userVo){
        return iUserService.forgetPassword(userVo);
    }

    @Anonymous
    @PostMapping("/update/password")
    public R<Boolean> updatePassword(@RequestBody UserVo userVo){
        return iUserService.updatePassword(userVo);
    }

}
